#!/usr/bin/php -q
<?php // vim:set fdm=indent ts=2 ai et sts=2 sw=2 tw=0:

include("inc/config.php");
include("inc/class.db.php");
include("inc/dict.php");
include("inc/xml.php");

$packet = $argv[1];

$from   = GetElementPropertyByName($packet, "presence", "from");
$show   = GetElementByName($packet, "show");
$status = GetElementByName($packet, "status");

// dnd => unavailable, away => away, nothing => available
if ( $from=="" && $status == "" )
    echo $packet;
  else
    echo "$from current status='$status' show='$show'";
?>
